After many years of using the autotools build system, the developers of Scribus have selected CMake as a replacement system. It provides a much more flexible setup with a lot less complexity. It also provides compatibility with build tools on Linux and variants of Unix, Windows and Mac OSX.
To build with the CMake build system you will of course need CMake itself. Most Linux and some Unix distributions provide it as a standard package. If not, please download it, make sure you get a recent version, like 2.4.3 or higher. MacOSX users can also find installers there as well. Scribus does not yet use CMake for Windows, although this may be added in the future.
One of the advantages of CMake is that we can build "out of source". This means that when the program is being built the temporary files and resulting application files are not stored in the same location as the Scribus source files. This helps keeping directory structures clean and will also reduce time for updating your source tree a little. This is the preferred method, however both are described below.
Let's assume the following:
/home/username/scribussource/
(where username is your username)/usr/bin/
/home/username/scribusinstall/
Change to the source directory:
cd /home/username/scribussource/
Then run:
/usr/bin/cmake . -DCMAKE_INSTALL_PREFIX:PATH=/home/username/scribusinstall/
If this is the build location you have chosen, please skip down to the Build Stage section
Change to the source directory:
cd /home/username/scribussource/
Make a directory to build Scribus in:
mkdir builddir
Change to the build directory:
cd builddir
Then run:
/usr/bin/cmake ../Scribus -DCMAKE_INSTALL_PREFIX:PATH=/home/username/scribusinstall/
Once the CMake command you have chosen above has completed successfully (remember it needs to find the dependencies of Scribus and record their locations), then you need to run:
make && make install
Some options that the Scribus CMake files know about (more to come!):
For example: to make a cairo debug build, then something like this (all on one line):
/usr/bin/cmake . -DCMAKE_INSTALL_PREFIX:PATH=/home/username/scribusinstall -DWANT_CAIRO=1 -DWANT_DEBUG=1 -DWANT_VERSIONING=1
Whenever your distribution releases their package for a library Scribus depends on, it may still not be the very latest stable or unstable version from the writers of the library. In some cases, the Scribus developers have had to rely on the very latest code to further some parts of Scribus. In this case it is necessary to build your own version of such a library.
On example of this is the cairo graphics library. Right now, 1.3.4cvs has the capability to use the very very latest code from the just released cairo 1.2.4.
To specify a new cairo install path, other than your system's default add this to the cmake command line: -DPREFIX_CAIRO:PATH=/path/to/your/cairo/install
Systems with both Qt3 and Qt4 installed: You have uic
and moc
from Qt4 in the path and it may results to the compilation crash. This should NOT be the case with CMake 2.4.2 and higher, or when using current Scribus CVS. However, this might be a useful workaround:
Remove cached options from previous cmake configuration run from your build location: rm CMakeCache.txt
Then change PATH variable (for my Gentoo) e.g.:
export PATH=/usr/qt/3/bin/:$PATH
And run cmake config phase again:
/usr/bin/cmake . -DCMAKE_INSTALL_PREFIX:PATH=/home/username/scribusinstall/
To make a tarball for distribution, the old way would be to make dist
.
The new way is to run:
make package_source
or
/usr/bin/cpack -G TBZ2 --config CPackSourceConfig.cmake
to give you a bundle of the source. With cmake 2.4.1 there is only support for a gzip tar.gz however a bzip2 tar.bz2 is possible with later versions of cmake.
Important: If you need to re-run cpack remove the _CPack_Packages/
before running this a second time.
If after reading these instructions through and you still have issues, please join us on IRC or post a mail to our mailing list with specifics of your problem. We also are interested in hearing from folks who have successfully compiled Scribus on non-Linux platforms too.